package collectionfram;

import java.util.LinkedList;

public class LinkListDemo01 {
    public static void main(String[] args) {
        LinkedList dogs = new LinkedList();
        dogs.add(new Dog("dog1"));
        dogs.add(new Dog("dog2"));
        dogs.add(new Dog("dog3"));
        dogs.add(2,new Dog("dog4"));
        for (int i = 0; i < dogs.size(); i++) {
            Dog dog = (Dog) dogs.get(i);
            System.out.println(dog.getName());
        }
    }
}